#include <iostream>
#include <cstring>
using namespace std;

const int N = 2e6+3 , null = 0x3f3f3f3f;
int h[N];

int find(int x)
{
    //若找的到x，返回x在表中的下标
    //若找不到x，返回x应该插入的位置
    int k = (x % N + N) % N;
    while(h[k] != null && h[k] != x)
    {
        ++ k;
        if(k == N) k = 0;
    }
    return k;
}

int main()
{
    int n;
    scanf("%d",&n);
    memset(h,null,sizeof h);
    while(n--)
    {
        char op[2];
        int x;
        scanf("%s%d",op,&x);
        if(*op == 'I'){
            int k = find(x);
            h[k] = x;
        }else{
            int k = find(x);
            if(h[k] == x) printf("Yes");
            else printf("No");
        }
    }
    return 0;
}


